package services

import (
	"bsm/daos"
	"bsm/models"
)

// 在services包中定义接口
type CompareService interface {
	GetOrgAll() ([]models.Org, error)
	GetProjectDiff(pcode string) ([]models.ProjectDiff, error)
	GetProjectDiffDetail(pcode string) ([]models.ProjectDiffDetail, error)
}

// 实现DifferenceService接口
type compareServiceImpl struct {
	pmsDao daos.PmsDao
}

func NewDifferenceService(pmsDao daos.PmsDao) CompareService {
	return &compareServiceImpl{
		pmsDao: pmsDao,
	}
}

func (qs *compareServiceImpl) GetOrgAll() ([]models.Org, error) {
	return qs.pmsDao.GetAllOrg()
}

func (qs *compareServiceImpl) GetProjectDiff(pcode string) ([]models.ProjectDiff, error) {
	return qs.pmsDao.GetProjectDiffs(pcode)
}

func (qs *compareServiceImpl) GetProjectDiffDetail(pcode string) ([]models.ProjectDiffDetail, error) {
	return qs.pmsDao.GetProjectDiffDetails(pcode)
}
